<script setup>
import {useDictStore} from "@/store/sys/dict.js";

const props = defineProps({
  code: {
    type: String,
    required: true
  },
  value: {
    type: String,
    required: true
  }
})
const dictStore = useDictStore()
const label = computed(() => {
  const item = (dictStore.getDictByCode(props.code) || []).find(item => item.value === props.value)
  return item ? item.label : '-'
})
</script>

<template>
  <n-text>{{label}}</n-text>
</template>

<style scoped>

</style>